package com.texplose.controller;

import com.texplose.entity.Star;
import com.texplose.entity.vo.ResponseResult;
import com.texplose.service.StarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

/**
 * @author : lyj
 * @Timer : 2022/5/30
 * @Description :
 */
@RestController
@RequestMapping("/star")
public class StarController {
    @Autowired
    private StarService starService;

    /**
     * 点赞
     * @param star
     * @return
     */
    @PostMapping("/insert")
    public ResponseResult insertStar(@RequestBody Star star){
        starService.insert(star);
        return ResponseResult.okResult();
    }

    /**
     * 取消点赞
     * @param star
     * @return
     */
    @DeleteMapping("/delete")
    public ResponseResult deleteStar(@RequestBody Star star){
        return starService.delete(star);
    }

}
